import {
	http,
	Method
} from "@/utils/request.js";

import api from "@/config/api.js";


/**
 * 获取全部商品
 * @param 
 */
export function getProduct() {
	return http.request({
		url: '/products',
		method: Method.GET,
	});
}

/**
 * 获取特惠商品
 * @param 
 */
export function getProductList() {
	return http.request({
		url: '/products/special-offers',
		method: "GET",
	});
}
/**
 * 获取物业商品
 * @param 
 */
export function getPropertyProduct(id) {
	return http.request({
		url: `/products/search?shop=${id}`,
		method: "GET",
	});
}
/**
 * 搜索店铺
 * @param 
 */
export function getShopsSearch() {
	return http.request({
		url: `/shops/search?name=物业热销`,
		method: Method.GET,

	});
}

/**
 * 搜索商品
 * @param 
 */
export function getGoodsSearch(params) {
	return http.request({
		url: `/products/search?keyword=${params}`,
		method: Method.GET,
	});
}
/**
 * 获取店铺
 * @param 
 */
export function getProductCategory(id) {
	return http.request({
		url: '/shops',
		method: Method.GET,

	});
}

/**
 * 根据店铺获取商品
 * @param 
 */
export function getShopsProduct(id) {
	return http.request({
		url: `/products/search?shop=${id}`,
		method: Method.GET,

	});
}
/**
 * 获取通知公告
 * @param 
 */
export function getNotice() {
	return http.request({
		url: '/notices',
		method: Method.GET,

	});
}

/**
 * 获取排行榜
 * @param 
 */
export function getRaning(data) {
	return http.request({
		url: '/ranks',
		method: Method.GET,
		data
	});
}

// 获取轮播图
export function getBanner() {
	return http.request({
		url: '/banners',
		method: 'GET'
	})
}